package com.qifenqian.turbot.base

import android.content.Context

/**
 * @author H
 * @createDate 2018/8/9 12:06
 * @reference
 * @updateDate
 * @description
 * @detail
 * @since
 */
abstract class BasePresenter<V, M : BaseModel>(context: Context, view: V) {

    protected var mContext: Context = context
    protected var mView: V? = view
    protected var mModel: M

    abstract fun createModel(): M

    init {
        mModel = this.createModel()
    }

    fun attachView(view: V) {
        mView = view
    }

    fun detachView() {
        mView = null
    }

}